package com.example.javaee.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * @Description: 评论实体类
 */
@Data
public class Comment {

    // post需要的字段
    private Long id;
    Integer userId;
    private String content;
    private Long parentCommentId;
    private Long courseNumber;
    //
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
    private Long courseCommentId;//若为二级以上评论，存储该评论对应课程评论区下哪个评论，否则置为自己的id
    private Long likeCount;
    private Long dislikeCount;
    //非数据库字段
    //回复评论
    private List<Comment> replyComments = new ArrayList<>();

    private String nickname;
    private String avatar;
    private Comment parentComment;
    private String parentNickname;
    private String courseName;
    //省去了get和set还有toString方法

    @Override
    public String toString() {
        return "Comment{" +
                "id=" + id +
                ", nickname='" + nickname + '\'' +
                ", content='" + content + '\'' +
                ", createTime=" + createTime +
                ", parentCommentId=" + parentCommentId +
                ", courseNumber=" + courseNumber +
                ", replyComments=" + replyComments +
                ", parentComment=" + parentComment +
                ", parentNickname='" + parentNickname + '\'' +
                '}';
    }
    /*
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }
    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Long getParentCommentId() {
        return parentCommentId;
    }

    public void setParentCommentId(Long parentCommentId) {
        this.parentCommentId = parentCommentId;
    }

    public Long getCourseId() {
        return courseId;
    }

    public void setCourseId(Long courseId) {
        this.courseId = courseId;
    }

    public List<Comment> getReplyComments() {
        return replyComments;
    }

    public void setReplyComments(List<Comment> replyComments) {
        this.replyComments = replyComments;
    }

    public Comment getParentComment() {
        return parentComment;
    }

    public void setParentComment(Comment parentComment) {
        this.parentComment = parentComment;
    }

    public String getParentNickname() {
        return parentNickname;
    }

    public void setCourseCommentId(Long courseCommentId)
    {
        this.courseCommentId = courseCommentId;
    }

    public Long getCourseCommentId()
    {
        return this.courseCommentId;
    }

    public void setParentNickname(String parentNickname) {
        this.parentNickname = parentNickname;
    }

    public Long getLikeCount()
    {
        return this.likeCount;
    }

    public void setLikeCount(Long likeCount)
    {
        this.likeCount = likeCount;
    }

    public Long getDislikeCount()
    {
        return this.dislikeCount;
    }

    public void setDislikeCount(Long dislikeCount)
    {
        this.dislikeCount = dislikeCount;
    }

     */

}
